<template><div><h2 id="版本升级须知" tabindex="-1"><a class="header-anchor" href="#版本升级须知"><span>版本升级须知</span></a></h2>
<h3 id="说明" tabindex="-1"><a class="header-anchor" href="#说明"><span>说明</span></a></h3>
<p><code v-pre>Dcat Admin</code>的版本发行将会参考主流<code v-pre>web框架</code>的发行策略，尽量降低版本升级带来的影响，小版本和补丁<strong>决不</strong>包含非兼容性更改；同时我们也将会提供更新日志，详细说明新版本的改动以及可能造成的影响。</p>
<h3 id="升级命令" tabindex="-1"><a class="header-anchor" href="#升级命令"><span>升级命令</span></a></h3>
<p>升级命令</p>
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre class="language-bash"><code><span class="line"><span class="token function">composer</span> update dcat/laravel-admin</span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>升级成功之后需要运行 <code v-pre>admin:update</code> 命令进行重新发布语言包、配置文件、前端静态资源等文件，然后<strong>清理浏览器缓存</strong></p>
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre class="language-bash"><code><span class="line"><span class="token comment"># 发布 语言包、配置文件、前端静态资源、数据迁移文件等</span></span>
<span class="line">php artisan admin:update</span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>运行 <code v-pre>admin:update</code>，相当于运行</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line">php artisan admin<span class="token punctuation">:</span>publish <span class="token operator">--</span>assets <span class="token operator">--</span>migrations <span class="token operator">--</span>lang <span class="token operator">--</span>force</span>
<span class="line">php artisan migrate</span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="发布文件命令" tabindex="-1"><a class="header-anchor" href="#发布文件命令"><span>发布文件命令</span></a></h4>
<blockquote>
<p>运行 <code v-pre>admin:update</code> 后一般不需要运行 <code v-pre>admin:publish</code> 命令</p>
</blockquote>
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre class="language-bash"><code><span class="line">php artisan admin:publish <span class="token parameter variable">--force</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>只更新语言包</p>
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre class="language-bash"><code><span class="line">php artisan admin:publish <span class="token parameter variable">--force</span> <span class="token parameter variable">--lang</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>只更新配置文件</p>
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre class="language-bash"><code><span class="line">php artisan admin:publish <span class="token parameter variable">--force</span> <span class="token parameter variable">--config</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>只更新前端静态资源</p>
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre class="language-bash"><code><span class="line">php artisan admin:publish <span class="token parameter variable">--force</span> <span class="token parameter variable">--assets</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>只更新数据库迁徙文件(这个一般不需要更新)</p>
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre class="language-bash"><code><span class="line">php artisan admin:publish <span class="token parameter variable">--force</span> <span class="token parameter variable">--migrations</span></span>
<span class="line"></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></div></template>


